{extend name="public/base" /}

{block name="title"}<title>{$Think.lang.list}</title>{/block}

{block name="pjax_container"}
<section class="content-header">
    <h1>文章分类</h1>
    <ol class="breadcrumb">
        <li class="active"><i class="fa fa-dashboard"></i> 文章分类</li>
    </ol>
</section>
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <div class="box box-primary">
                <div class="box-header with-border">
                    <h3 class="box-title"></h3>
                    <div class="pull-left">
                        {:authAction(CONTROLLER_NAME.'/create', 'create')}

                    </div>
                    {include file="public/search" /}
                </div>
                <div class="box-body table-responsive">
                    <table class="table table-bordered table-hover">
                        <tr>
                            <th>{$Think.lang.id}</th>
                            <th>{$Think.lang.picname}</th>
                            <th>{$Think.lang.url}</th>
                            <th>{$Think.lang.content}</th>

                            <th>{$Think.lang.status}</th>
                            <th>{$Think.lang.create_time}</th>
                            <th>环境</th>
                        </tr>
                        {volist name="dataList" id="vo"}
                        <tr>
                            <td>{$vo.id}</td>
                            <td>{$vo.picname}</td>
                            <td><img src="{$vo.url}" width="50px"></td>
                            <td>{$vo.content|htmlspecialchars_decode|html_entity_decode}</td>
                            <td>
                                <a href="javascript:void(0);" data-id="{$vo.id}" data-field="status"
                                   data-value="{$vo.status}" data-url="{:url('edit', 'id='.$vo['id'])}"
                                   class='editimg fa {if condition=" $vo.status == 1 "}fa-check-circle text-green{else /}fa-times-circle text-red{/if}'></a>
                            </td>

                            <td>{$vo.create_time}</td>
                            <td>
                                {include file="public/list_action" /}
                            </td>
                        </tr>
                        {/volist}
                    </table>
                </div>
            </div>
        </div>
    </div>
</section>
<script type="text/javascript">
$(function(){
    $('.editable').editable({
        emptytext: "empty",
        params: function(params) {      //参数
            var data = {};
            data['id'] = params.pk;
            data[params.name] = params.value;
            return data;
        },
        success: function(response, newValue) {
            var res = $.parseJSON( response );
            if(res.status == 1){
            }else{
                return res.info;
            }
        }
    });

    {if condition=" $rest_login == 1 "}
    restlogin('{$rest_login_info}');   //登录超时
    {/if}
})
</script>
{/block}